//
//  MineWorkerGuideZhuanqianView.m
//  Btpin
//
//  Created by Vic on 2019/5/28.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "MineWorkerGuideZhuanqianView.h"

@implementation MineWorkerGuideZhuanqianView

- (instancetype)initWithTarget:(id)target {
    self = [super init];
    if (self) {
        [self initUI];
        self.delegate = target;
    }
    return self;
}
- (void)initUI {
    self.frame = CGRectMake(0, 0, WIDTH, HEIGHT);
    self.backgroundColor = [UIColor colorWithWhite:0.01 alpha:0.65];
    [[UIApplication sharedApplication].keyWindow addSubview:self];
    
    CGFloat imgViewHeight = WIDTH*(421/785.0);
    UIImageView *imgView = [UIToolsControl initImageViewWithFrame:CGRectMake(0, MineCellHeight*4+231*Scale-imgViewHeight, WIDTH, imgViewHeight) imageName:@"zhuanqian_tishi"];
//    UIImageView *imgView = [UIToolsControl initImageViewWithFrame:CGRectMake(0, MineCellHeight*5+231*Scale-imgViewHeight, WIDTH, imgViewHeight) imageName:@"zhuanqian_tishi"];
    [self addSubview:imgView];
    imgView.userInteractionEnabled = NO;
    
    UILabel *titleLbl = [UIToolsControl initLabelWithFrame:CGRectMake(WIDTH*0.5-70*Scale, EndY(imgView)+MineCellHeight, 140*Scale, 40*Scale) text:@"我知道啦" textColor:COLOR_OF_WHITE font:Font_16];
    titleLbl.font = FontBold(Font_16);
    titleLbl.textAlignment = NSTextAlignmentCenter;
    titleLbl.backgroundColor = THEMECOLOR_OF_ORANGE;
    titleLbl.layer.cornerRadius = 20*Scale;
    titleLbl.layer.masksToBounds = YES;
    [self addSubview:titleLbl];
    
    UIButton *btn = [UIToolsControl initButtonWithFrame:self.bounds imageName:nil target:self action:@selector(btnTap) title:nil titleColor:nil];
    [self addSubview:btn];
}
- (void)btnTap {
    if (self.delegate && [self.delegate respondsToSelector:@selector(mineWorkerGuideZhuanqianViewTap)]) {
        [self.delegate mineWorkerGuideZhuanqianViewTap];
    }
}

@end
